Enduring CSS by Ben Frain
Author:Ben Frain [Ben Frain]
Language: eng
Format: epub, azw3, mobi, pdf
Tags: Web, Programming Languages, Computers, General, Html, Design, Web Development, Web Programming
ISBN: 9781787284531
Google: xU8oDwAAQBAJ
Amazon: B01N5JUQR6
Publisher: Packt Publishing
Published: 2017-01-17T00:00:00+00:00
Tip
When naming the class for the outermost container of a module or component, no child extension should be added to the class/selector. Only the child parts of a module or component should get the node extension.
OK, so, at this point, our selectors could be named like this in the style sheets:
.mod-ShoppingCart {} /*Modal*/ .page-ShoppingCart {} /*Page*/ .mod-ShoppingCartLines {} /*Modal*/ .page-ShoppingCartLines {} /*Page*/
This way our module and component have their two contexts isolated by a namespace switch. We are free to style each as we see fit with no potential leakage of styles from one to the other. This is the exact kind of scenario that typically becomes fraught when components and modules share HTML classes in the interest of abstraction and re-use.
Let's consider a twist on this scenario. Let's suppose we don't switch contexts with application logic. Instead, we have a switch of styles with media queries. We have a modal implementation at smaller viewports and the page style, in normal document flow, at larger viewports.
In this instance, we could have a single namespace e.g. sc-ShoppingCart (I'm using sc- to designate the context is ShoppingCart) and use media queries in the CSS to provide visual changes.
For example:
.sc-ShoppingCart { /*Modal styles for smaller viewports*/ @media (min-width: $M) { /* Page styles for larger viewports */ } } .sc-ShoppingCartLines { /* Modal styles for smaller viewports */ @media (min-width: $M) { /* Page styles for larger viewports */ } }
Download
Enduring CSS by Ben Frain.azw3
Enduring CSS by Ben Frain.mobi
Enduring CSS by Ben Frain.pdf
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Sass and Compass in Action by Wynn Netherland Nathan Weizenbaum Chris Eppstein Brandon Mathis(7796)
Grails in Action by Glen Smith Peter Ledbrook(7706)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(6429)
Kotlin in Action by Dmitry Jemerov(5077)
WordPress Plugin Development Cookbook by Yannick Lefebvre(3882)
Mastering Azure Security by Mustafa Toroman and Tom Janetscheck(3339)
Learning React: Functional Web Development with React and Redux by Banks Alex & Porcello Eve(3095)
Mastering Bitcoin: Programming the Open Blockchain by Andreas M. Antonopoulos(2878)
The Art Of Deception by Kevin Mitnick(2616)
Drugs Unlimited by Mike Power(2476)
The Innovators: How a Group of Hackers, Geniuses, and Geeks Created the Digital Revolution by Walter Isaacson(2391)
Kali Linux - An Ethical Hacker's Cookbook: End-to-end penetration testing solutions by Sharma Himanshu(2317)
A Blueprint for Production-Ready Web Applications: Leverage industry best practices to create complete web apps with Python, TypeScript, and AWS by Dr. Philip Jones(2317)
Writing for the Web: Creating Compelling Web Content Using Words, Pictures and Sound (Eva Spring's Library) by Lynda Felder(2270)
SEO 2018: Learn search engine optimization with smart internet marketing strategies by Adam Clarke(2197)
JavaScript by Example by S Dani Akash(2143)
DarkMarket by Misha Glenny(2087)
Wireless Hacking 101 by Karina Astudillo(2084)
Hands-On Cybersecurity with Blockchain by Rajneesh Gupta(2029)
